home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03060600.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  2.4 KB  |  36 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Xor-Operator [Runtime]</title><meta name="filename" content="text/sbasic/common/03060600"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <help:to-be-embedded Eid="xor" xmlns:help="http://openoffice.org/2000/help">
  14.   <p class="Head1"><help:link Id="66621">Xor-Operator [Runtime]</help:link></p>
  15.   <p class="Paragraph">Performs a logical Exclusive-Or combination of two expressions.</p>
  16.   </help:to-be-embedded>
  17.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  18.   <p class="Paragraph">Result = Expression1 Xor Expression2 <help:key-word value="Xor" tag="kw66621_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  19.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  20.   <p class="Paragraph">Result: Any numeric variable that contains the result of the combination.</p>
  21.   <p class="Paragraph">Expression1, Expression2 : Any numeric expressions to be combined.</p>
  22.   <p class="Paragraph">A logical Exclusive-Or conjunction of two Boolean expressions returns <span class="T1">True</span> only if both expressions are different from each other.</p>
  23.   <p class="Paragraph">A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions.</p>
  24.   <p class="P2">Example:</p>
  25.   <p class="PropText">Sub ExampleXor</p>
  26.   <p class="PropText">Dim vA as Variant, vB as Variant, vC as Variant, vD as Variant</p>
  27.   <p class="PropText">Dim vOut as Variant</p>
  28.   <p class="PropText">vA = 10: vB = 8: vC = 6: vD = Null</p>
  29.   <p class="PropText">vOut = vA > vB Xor vB > vC <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>REM returns 0</p>
  30.   <p class="PropText">vOut = vB > vA Xor vB > vC <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>REM returns -1</p>
  31.   <p class="PropText">vOut = vA > vB Xor vB > vD <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>REM returns 0</p>
  32.   <p class="PropText">vOut = (vB > vD Xor vB > vA) REM returns -1</p>
  33.   <p class="PropText">vOut = vB Xor vA <text:s text:c="10" xmlns:text="http://openoffice.org/2000/text"/>REM returns 2</p>
  34.   <p class="PropText">End Sub</p>
  35.   <p class="PropText"/>
  36.  </body></html>